// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
import Lockr from 'lockr'
import store from './vuex/store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import _g from './assets/js/global'
import VueRouter from 'vue-router'

Vue.config.productionTip = false

axios.defaults.baseURL = 'http://192.168.0.233/'

axios.defaults.timeout = 1000 * 15
axios.defaults.headers.authKey = Lockr.get('authKey')
axios.defaults.headers.sessionId = Lockr.get('sessionId')
axios.defaults.headers['Content-Type'] = 'application/json'
axios.defaults.withCredentials = true
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'

Vue.use(ElementUI)
Vue.use(VueRouter)

window.axios = axios
window.Lockr = Lockr
window._g = _g
window.store = store
/* eslint-disable no-new */
const bus = new Vue()
window.bus = bus

new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
